/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


function Survey(title, description, startDate, endDate, point, share) {
        this.title = title;
        this.description = description;
        this.beginDay = startDate;
        this.endDay = endDate;
        this.point = point;
        this.share = share;
        this.questions = new Array();
        this.addToQuestions = addToQuestions;

    }
    function addToQuestions(question) {
        this.questions.push(question);
    }

    function addChoices(answer) {
        this.choices.push(answer);
    }

    function Question(index, title, helpText, type, require) {
        this.idQues = index;
        this.titleQues = title;
        this.helpText = helpText;
        this.type = type;
        this.require = require;
        this.choices = new Array();
        this.addChoices = addChoices;
    }
     function Response(idUser) {
        this.idUser = idUser;
        this.answers = new Array();
        this.addAnswers = addAnswers;
    }

    function addAnswers(answer) {
        this.answers.push(answer);
    }
    function AnswerItem(type, idQues, answer, require) {
        this.type = type;
        this.require = require;
        this.idQues = idQues;
        this.answer = answer;
    }